﻿/**
 * 
 * Copyright 2009, 2010 Mike Jamer [email: mikejamer@gmail.com ]
 * 
 * This File is part of Moose IRC
 * 
 * MooseIRC is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * MooseIRC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with MooseIRC.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace moose.irc
{
    /// <summary>
    /// Irc Channel Mode
    /// </summary>
    [CLSCompliant(true)]
    public class IrcChannelMode : object
    {

        /// <summary>
        /// Channel Mode
        /// </summary>
        private char m_mode;

        /// <summary>
        /// Mode Arguments
        /// </summary>
        private List<string> m_args;



        /// <summary>
        /// Gets Channel Mode
        /// </summary>
        public char Mode { get { return m_mode; } }

        /// <summary>
        /// Initialize Channel Mode
        /// </summary>
        public IrcChannelMode( char mode )
            : base()
        {

            m_mode = mode;
            m_args = new List<string>();

            return;
        }

        /// <summary>
        /// Add a new argument
        /// </summary>
        /// <param name="argumnet">argument</param>
        public void add_arg(string argumnet)
        {
            if (!m_args.Contains(argumnet))
                m_args.Add(argumnet);

            return;
        }

        /// <summary>
        /// Remove an existing argument
        /// </summary>
        /// <param name="argument">argument</param>
        public void remove_arg(string argument)
        {
            if (m_args.Contains(argument))
                m_args.Remove(argument);
        }

        /// <summary>
        /// Clear Arguments
        /// </summary>
        public void clear_arguments()
        {
            m_args.Clear();
        }

        /// <summary>
        /// Get all Arguments
        /// </summary>
        /// <returns>Enumerable Collection of all arguments</returns>
        public IEnumerable<string> get_arguments()
        {
            return m_args;
        }

    }
}
